/*
 * @Author: 吴华胜 765510616@qq.com
 * @Date: 2023-05-02 15:40:25
 * @LastEditors: 吴华胜 765510616@qq.com
 * @LastEditTime: 2023-05-24 09:50:09
 * @FilePath: \di-award-admin\src\api\web\forum.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import request from '@/utils/request'
import router from '@/router/routers'
export function addAdmin(data) {
  return request({
    url: data.adminId ? '/api/admin/edit' : '/api/admin/create',
    method: 'post',
    data
  })
}
export function other() {
  router.push('/sys/admin/add')
}
export function del(data) {
  return request({
    url: `/api/admin/delete`,
    method: 'post',
    data
  })
}
export function edit(data) {
  return request({
    url: '/api/admin/edit',
    method: 'post',
    data
  })
}
export function getList(data) {
  return request({
    url: '/api/admin/list',
    method: 'post',
    data
  })
}
export function getInfoById(data) {
  return request({
    url: '/api/admin/detail',
    method: 'post',
    data
  })
}

export default { addAdmin, edit, del, getList, getInfoById, other }
